package com.ts.host;


import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;


import com.rio.core.U;
import com.rio.layout.IToast;
import com.rio.layout.IToast;
import com.rio.layout.PopupManager;
import com.rio.layout.view.SimpleToast;



public class TToast extends SimpleToast {
	

	TextView mToast;
	String mMsg;
	
	public static void show(String msg) {
		if (U.notNull(msg)) {
			TToast mInstance = new TToast();
			mInstance.mMsg = msg;
			PopupManager.getInstance().show(mInstance);
		}

	}
	
	public static void show(int msg) {
		if (U.notNull(msg)) {
			TToast mInstance = new TToast();
			mInstance.mMsg = APP.getStr(msg);
			PopupManager.getInstance().show(mInstance);
		}
	}

	@Override
	public View onAttach(LayoutInflater layout) {
		View view = layout.inflate(R.layout.toast, null);
		mToast = (TextView) view.findViewById(R.id.toast);
		mToast.setText(mMsg);
		return view;
	}

	@Override
	public void onDetach() {
		mToast = null;
		mMsg = null;
	}

	@Override
	public void onDisplay(String callerName, View view, int frag,
			Object... params) {

	}

	
	@Override
	public long getDuration() {
		// TODO Auto-generated method stub
		return 2400;
	}

}
